package com.zxx.xin.shorthand.helper;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import com.zxx.xin.shorthand.R;
import com.zxx.xin.shorthand.app.ApplicationHelper;

import java.io.File;

/**
 * Created by xin on 2018/3/21.
 */

public class ShareUtils {

    public static void shareBitmap(Context context, File file){
        Uri uri = Uri.fromFile(file);
        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_SEND);
        intent.setType("image/*");
        intent.putExtra(Intent.EXTRA_STREAM, uri);
        intent = intent.createChooser(intent, ApplicationHelper.getContext().getString(R.string.share));
        context.startActivity(intent);
    }

}
